The 'while' statement implements a loop whose statement (or compound statement) is repeated until the conditional expression evaluates to 0 (false):
while (expression)
statement
In the following example the null statement is used, since the side effect of evaluating the expression implements all the desired processing:
while (!mouse_button_is_down())
;
An interesting application of the comma operator mentioned earlier in this chapter is to evaluate a sequence of expressions in place of the usual condition. The expressions are evaluated left to right, and the loop continues until the rightmost expression is false. In the following example the side effect of the leftmost expression is assigning a value to the character variable c. (The standard library function getchar() returns the next character from the standard input device.)